/** When your routing table is too long, you can split it into small modules**/
// 系统管理
import Layout from '@/views/layout/Layout';

const adminRouter = {
  path: '/admin',
  component: Layout,
  redirect: 'noredirect',
  name: 'admin',
  meta: {
    title: '平台设置',
    icon: 'settings',
    access: ['menu:admin']
  },
  children: [{
    path: 'system',
    component: () => import('@/views/admin/system/index'),
    name: 'adminSystem',
    meta: {
      title: '系统管理',
      icon: 'system',
      access: ['menu:admin:system']
    }
  },
  {
    path: 'config',
    component: () => import('@/views/admin/config/index'),
    name: 'adminConfig',
    meta: {
      title: '配置管理',
      icon: 'dictionary',
      access: ['menu:admin:config']
    }
  }, {
    path: 'dict',
    component: () => import('@/views/admin/dict/index'),
    name: 'adminDict',
    meta: {
      title: '字典管理',
      icon: 'dictionary',
      access: ['menu:admin:dict']
    }
  },
  {
    path: 'permission',
    component: () => import('@/views/admin/permission/index'),
    name: 'adminPermission',
    meta: {
      title: '权限管理',
      icon: 'permission',
      access: ['menu:admin:permission']
    }
  },
  {
    path: 'role',
    component: () => import('@/views/admin/role/index'),
    name: 'adminRole',
    meta: {
      title: '角色管理',
      icon: 'role',
      access: ['menu:admin:role']
    }
  },
  {
    path: 'role/auth/:id',
    component: () => import('@/views/admin/role/auth'),
    name: 'adminRoleAuth',
    meta: {
      title: '角色授权',
      icon: 'auth',
      access: ['menu:admin:role']
    },
    hidden: true
  },
  {
    path: 'org',
    component: () => import('@/views/admin/org/index'),
    name: 'adminOrg',
    meta: {
      title: '机构管理',
      icon: 'organization',
      access: ['menu:admin:org']
    }
  },
  {
    path: 'org/tree/:id',
    component: () => import('@/views/admin/org/tree-base'),
    name: 'adminOrgTree',
    meta: {
      title: '机构详情',
      icon: 'organization',
      access: ['menu:admin:org']
    },
    hidden: true
  },
  {
    path: 'org/user/:id',
    component: () => import('@/views/admin/org/org-user'),
    name: 'adminOrgUser',
    meta: {
      title: '机构用户',
      icon: 'user-list',
      access: ['menu:admin:org']
    },
    hidden: true
  },
  // {
  //   path: 'user',
  //   component: () => import('@/views/admin/user/index'),
  //   name: 'adminUser',
  //   meta: {
  //     title: '用户管理',
  //     icon: 'user',
  //     access: ['menu:admin:user']
  //   }
  // },
  {
    path: 'security',
    component: () => import('@/views/admin/security/index'),
    name: 'adminSecurity',
    meta: {
      title: '安全设置',
      icon: 'safe',
      access: ['menu:admin:security']
    }
  }
  ]
};

export default adminRouter;
